package com.school.common;

import lombok.Getter;

/**
 * 返回状态码枚举
 */
@Getter
public enum ResultCode {
    
    /* 成功状态码 */
    SUCCESS(200, "操作成功"),
    
    /* 错误状态码 */
    ERROR(500, "操作失败"),
    
    /* 参数错误：1001-1999 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),
    
    /* 用户错误：2001-2999 */
    USER_NOT_LOGIN(2001, "用户未登录"),
    USER_LOGIN_ERROR(2002, "账号或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "账号已被禁用"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_HAS_EXISTED(2005, "用户已存在"),
    USER_PASSWORD_ERROR(2006, "密码错误"),
    
    /* 业务错误：3001-3999 */
    STUDENT_NOT_EXIST(3001, "学生不存在"),
    STUDENT_ID_EXISTED(3002, "学号已存在"),
    CLASS_NOT_EXIST(3003, "班级不存在"),
    CLASS_NAME_EXISTED(3004, "班级名称已存在"),
    DORMITORY_NOT_EXIST(3005, "宿舍不存在"),
    DORMITORY_IS_FULL(3006, "宿舍已满员"),
    BUILDING_NOT_EXIST(3007, "楼栋不存在"),
    BUILDING_NAME_EXISTED(3008, "楼栋名称已存在"),
    DATA_NOT_EXIST(3009, "数据不存在"),
    DATA_EXISTED(3010, "数据已存在"),
    
    /* Excel导入导出错误：4001-4999 */
    EXCEL_IMPORT_ERROR(4001, "Excel导入失败"),
    EXCEL_EXPORT_ERROR(4002, "Excel导出失败"),
    EXCEL_FORMAT_ERROR(4003, "Excel格式错误"),
    EXCEL_DATA_ERROR(4004, "Excel数据错误"),
    
    /* 系统错误：5001-5999 */
    SYSTEM_INNER_ERROR(5001, "系统内部错误"),
    SYSTEM_BUSY(5002, "系统繁忙，请稍后重试"),
    PERMISSION_NO_ACCESS(5003, "无权限访问");
    
    private final Integer code;
    private final String message;
    
    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}


